#include "ServerListenModel.h"

ServerListenModel::ServerListenModel(void)
{
  _defaultGameState = GameState::ServerListen;
  _menuItemCount = 2;
  _selectedMenuItem = 0;
  mListenAddr = NULL;
  mListenPort = 0;
}

ServerListenModel::~ServerListenModel(void)
{
  Eradicate();
}

void ServerListenModel::Eradicate(void)
{
  return;
}

GameState ServerListenModel::SendGameMessage(Message *m)
{
  return _defaultGameState;
}

int ServerListenModel::GetSelectedMenuItem(void)
{
  return _selectedMenuItem;
}

void ServerListenModel::IncrementMenuItemDown(void)
{
  if(_selectedMenuItem == (_menuItemCount - 1))
  {
    _selectedMenuItem = 0;
  }
  else
  {
    ++_selectedMenuItem;
  }
}

void ServerListenModel::IncrementMenuItemUp(void)
{
  if(_selectedMenuItem == 0)
  {
    _selectedMenuItem = _menuItemCount - 1;
  }
  else
  {
    --_selectedMenuItem;
  }
}
